package com.sys.SysModel.service.impl;

import java.util.List;

import com.sys.common.utils.DateUtils;
import com.sys.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sys.SysModel.mapper.SysModelTanksMapper;
import com.sys.SysModel.domain.SysModelTanks;
import com.sys.SysModel.service.ISysModelTanksService;

/**
 * 养殖桶模板Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-29
 */
@Service
public class SysModelTanksServiceImpl implements ISysModelTanksService 
{
    @Autowired
    private SysModelTanksMapper sysModelTanksMapper;

    /**
     * 查询养殖桶模板
     * 
     * @param id 养殖桶模板主键
     * @return 养殖桶模板
     */
    @Override
    public SysModelTanks selectSysModelTanksById(Long id)
    {
        return sysModelTanksMapper.selectSysModelTanksById(id);
    }

    /**
     * 查询养殖桶模板列表
     * 
     * @param sysModelTanks 养殖桶模板
     * @return 养殖桶模板
     */
    @Override
    public List<SysModelTanks> selectSysModelTanksList(SysModelTanks sysModelTanks)
    {
        return sysModelTanksMapper.selectSysModelTanksList(sysModelTanks);
    }

    /**
     * 新增养殖桶模板
     * 
     * @param sysModelTanks 养殖桶模板
     * @return 结果
     */
    @Override
    public int insertSysModelTanks(SysModelTanks sysModelTanks)
    {

        sysModelTanks.setCreateTime(DateUtils.getNowDate());
        sysModelTanks.setUpdateTime(DateUtils.getNowDate());

        sysModelTanks.setCanceledBy(SecurityUtils.getUsername());
        sysModelTanks.setCreatedBy(SecurityUtils.getUsername());

        return sysModelTanksMapper.insertSysModelTanks(sysModelTanks);
    }

    /**
     * 修改养殖桶模板
     * 
     * @param sysModelTanks 养殖桶模板
     * @return 结果
     */
    @Override
    public int updateSysModelTanks(SysModelTanks sysModelTanks)
    {
        sysModelTanks.setCreateTime(DateUtils.getNowDate());
        sysModelTanks.setUpdateTime(DateUtils.getNowDate());
        sysModelTanks.setCreatedBy(SecurityUtils.getUsername());
        sysModelTanks.setCanceledBy(SecurityUtils.getUsername());
        return sysModelTanksMapper.updateSysModelTanks(sysModelTanks);
    }

    /**
     * 批量删除养殖桶模板
     * 
     * @param ids 需要删除的养殖桶模板主键
     * @return 结果
     */
    @Override
    public int deleteSysModelTanksByIds(Long[] ids)
    {
        return sysModelTanksMapper.deleteSysModelTanksByIds(ids);
    }

    /**
     * 删除养殖桶模板信息
     * 
     * @param id 养殖桶模板主键
     * @return 结果
     */
    @Override
    public int deleteSysModelTanksById(Long id)
    {
        return sysModelTanksMapper.deleteSysModelTanksById(id);
    }
}
